package com.loong.order.mq;

import com.loong.common.rabbitmq.tools.RabbitmqTools;
import com.loong.global.enums.mq.QueueEnums;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * @Description:
 * @Author: hzp
 * @Date: 2020-12-29 14:18
 */
@Slf4j
@Configuration("orderMqConfiguration")
@DependsOn(value = {"rabbitmqDefaultConfiguration"})
public class OrderMqConfiguration {


    @Resource
    private RabbitmqTools rabbitmqTools;

    /**
     * 初始化OrderEsQueue 把消费到es的队列作为延迟队列
     */
    @PostConstruct
    public void initDelayTopicQueue() {
        rabbitmqTools.initDelayTopicQueue(QueueEnums.ORDER_ES);
    }

    /**
     * 初始化OrderDBQueue
     */
    @PostConstruct
    public void initOrderDbQueue() {
        rabbitmqTools.initTopicQueue(QueueEnums.ORDER_DB);
    }


    /**
     * 初始化处理死信订单DBQueue
     */
    @PostConstruct
    public void initExecutorDeadOrderDBQueue() {
        rabbitmqTools.initTopicQueue(QueueEnums.DEAD_ORDER_DB);
    }

    /**
     * 初始化处理死信订单ESQueue
     */
//    @PostConstruct
//    public void initExecutorDeadOrderESQueue() {
//        rabbitmqTools.initTopicQueue(QueueEnums.DEAD_ORDER_ES);
//    }
}
